package com.huike.contract.service.impl;

import com.huike.business.mapper.TbBusinessMapper;
import com.huike.clues.domain.vo.TbRedeploy;
import com.huike.clues.mapper.SysUserMapper;
import com.huike.clues.mapper.TbAssignRecordMapper;
import com.huike.clues.mapper.TbClueMapper;
import com.huike.clues.service.ISysUserService;
import com.huike.clues.service.ITbRulePoolService;
import com.huike.clues.domain.Transfer;
import com.huike.common.utils.bean.BeanUtils;
import com.huike.contract.domain.vo.TransferVo;
import com.huike.contract.mapper.TbContractMapper;
import com.huike.contract.service.ITransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.prefs.BackingStoreException;

@Service
public class TransferServiceImpl implements ITransferService {

    @Autowired
    private ISysUserService userService;

    @Autowired
    private TbAssignRecordMapper assignRecordMapper;

    @Autowired
    private ITbRulePoolService rulePoolService;

    @Autowired
    private SysUserMapper sysUserMapper;

    @Autowired
    private TbClueMapper clueMapper;


    @Autowired
    private TbBusinessMapper businessMapper;

    @Autowired
    private TbContractMapper tbContractMapper;


    @Override
    public List<TransferVo> list(Transfer Transfer) {
        List<TransferVo> list=new ArrayList<>();
        List<TbRedeploy> tbRedeploys = assignRecordMapper.selectAssignRecordByTransfer(Transfer);
        for (TbRedeploy tbRedeploy : tbRedeploys) {
            TransferVo transferVo=new TransferVo();
            BeanUtils.copyProperties(tbRedeploy,transferVo);
            list.add(transferVo);
        }
        return list;
    }
}
